import React, { PureComponent } from 'react';
import {
    View,
    Text,
    TouchableOpacity,
    StyleSheet
} from 'react-native';
import PropTypes from 'prop-types';
import {Button} from 'react-native-ui-kit/src/index'

class QuestionCell extends PureComponent {
    render() {
        const {question} = this.props;
        return (
            <TouchableOpacity onPress={this.show.bind(this,question)}>
                <View style={styles.cell}>
                    <Text style={styles.question}>{question.question}</Text>
                </View>

            </TouchableOpacity>
        );
    }
    show(question){
        this.props.show(question)
    }
}

const styles = StyleSheet.create({
    cell:{
        padding:15
    },
    question:{
        fontSize:16
    }
})

QuestionCell.propTypes = {
question:PropTypes.object,
    show:PropTypes.func
};

export default QuestionCell;